import { createRouter, createWebHistory } from 'vue-router'

// 导入页面组件
import Home from '../views/home/index.vue'
import Function from '../views/function/index.vue'
import Mine from '../views/mine/index.vue'
import Design from '../views/design/index.vue'
import Media from '../views/media/index.vue'
import Exercise from '../views/exercise/index.vue'
import Paper from '../views/paper/index.vue'
import Custom from '../views/custom/index.vue'
import PPT from '../views/ppt/index.vue'
import Feedback from '../views/feedback/index.vue'

// 定义路由
const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    meta: { title: '首页' }
  },
  {
    path: '/function',
    name: 'Function',
    component: Function,
    meta: { title: '功能中心' }
  },
  {
    path: '/ppt',
    name: 'PPT',
    component: PPT,
    meta: { title: 'PPT主题生成' }
  },
  {
    path: '/mine',
    name: 'Mine',
    component: Mine,
    meta: { title: '我的' }
  },
  {
    path: '/design',
    name: 'Design',
    component: Design,
    meta: { title: '教学设计生成' }
  },
  {
    path: '/media',
    name: 'Media',
    component: Media,
    meta: { title: '多媒体资源生成' }
  },
  {
    path: '/exercise',
    name: 'Exercise',
    component: Exercise,
    meta: { title: '练习题生成' }
  },
  {
    path: '/paper',
    name: 'Paper',
    component: Paper,
    meta: { title: '试卷生成' }
  },
  {
    path: '/custom',
    name: 'Custom',
    component: Custom,
    meta: { title: '个性化定制' }
  },
  {
    path: '/feedback',
    name: 'Feedback',
    component: Feedback,
    meta: { title: '反馈优化' }
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router